package com.rao;

import com.rao.core.startcollect.StartPrintUrlTagCollectEventBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.List;
import java.util.concurrent.CountDownLatch;

@SpringBootApplication
@Slf4j
public class RaoStudentMangerApp {
    private final static CountDownLatch countDownLatch = new CountDownLatch(1);

    public static void main(String[] args) throws InterruptedException {
        new Thread(() -> {
            log.info("-----开干={}=开干-----", "<简易的学生管理系统>");
            countDownLatch.countDown();
            try {
                //等待收集的url
                List<String> urls = StartPrintUrlTagCollectEventBean.urlExchanger.exchange(null);
                urls.stream().map(s -> "标记的url====" + s).forEach(log::info);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }, "懒羊羊的--game").start();
        countDownLatch.await();
        SpringApplication.run(RaoStudentMangerApp.class);
    }
}
